<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>用户报名信息编辑</title>
    <%@ include file="/WEB-INF/views/common/easyui.jsp"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
    <script src="${ctx}/static/plugins/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="${ctx}/static/plugins/easyui/common/jquery.select.js"type="text/javascript"></script>
    <link type="text/css" rel="stylesheet" href="${ctx}/static/css/table.css" />
</head>
<body>
<div>
    <form id="safeForm" method="post" action="${ctx}/bm/UserBmEdit" enctype="multipart/form-data">
        <input type="hidden" name="id" value="${baoming.id}" />
        <input type="hidden" name="userId" value="${baoming.userId}" />
        <input type="hidden" id="bsInfo" name="bsInfo"/>
        <table>
            <tr>
                <td colspan="4" style="background-color: #ccc;text-align: left;"> 基本信息</td>
            </tr>
            <tr>
                <td><label>姓名:</label></td>
                <td><input id="name" name="name" value="${baoming.name}"></input></td>
                <td><label>身份证号:</label></td>
                <td><input id="idCard" name="idCard" value="${baoming.idCard}" readonly="readonly"></input></td>
            </tr>
            <tr>
                <td><label>性别:</label></td>
                <td><select id="sex" name="sex">
                    <%--sexDic 性别字典--%>
                    <option value="">请选择</option>
                    <c:forEach items="${sexDic}" var="sexDic">
                        <option <c:if test='${sexDic.code == baoming.sex}'> selected='selected'</c:if> value="${sexDic.code}">${sexDic.name}</option>
                    </c:forEach>
                </select>
                </td>
                <td><label>联系方式:</label> </td>
                <td><input id="phone" name="phone" value="${baoming.phone}"></td>
            </tr>

            <tr>
                <td><label>来源地市:</label></td>
                <td>
                    <input style="width: 180px" id="pro" name="address" value="${baoming.address}">省</input>
                    <input style="width: 180px" id="city" name="city" value="${baoming.city}">市</input>
                </td>
                <td><label>年龄:</label></td>
                <td>
                    <input style="width: 397px" id="age" name="age" value="${baoming.age}">年</input>
                </td>
            </tr>

            <tr>
                <td><label>教练:</label></td>
                <td>
                    <input id="coach" name="coach" value="${baoming.coach}"></input>
                </td>
                <td><label>训练时间:</label></td>
                <td>
                    <input id="teaTime" name="teaTime" value="${baoming.teaTime}">年</input>
                </td>
            </tr>

            <tr>
                <td><label>参赛组别:</label></td>
                <td><select id="team" name="team"">
                    <%--sexDic 性别字典--%>
                    <option value="">请选择</option>
                    <c:forEach items="${TeamList}" var="TeamList">
                        <option <c:if test='${TeamList.code == baoming.team}'> selected='selected'</c:if> value="${TeamList.code}" >${TeamList.name}</option>
                    </c:forEach>
                </select></td>
                <td><label>衣服尺寸:</label> </td>
                <td><select id="clo" name="clo">
                    <%--cloDic 衣服尺寸字典--%>
                    <option value="">请选择</option>
                    <c:forEach items="${CloDic}" var="CloDic">
                        <option <c:if test='${CloDic.code == baoming.clo}'> selected='selected'</c:if> value="${CloDic.code}">${CloDic.name}</option>
                    </c:forEach>
                </select></td>
            </tr>

            <tr>
                <td colspan="4" style="background-color: #ccc;text-align: left;">参赛信息</td>
            </tr>
            <tr>
                <td><label>参赛项目:</label></td>
                <td colspan="3">
                    <%--参赛项目字典--%>
                    <c:forEach items="${ItemDic}" var="dic">
                        <input <c:if test='${fn:containsIgnoreCase(baoming.bsInfo,dic.code)}'>checked="checked"</c:if>
                         style="width: 30px" onclick="checkBox()" name="channel_box" type="checkbox" value="${dic.code}"/>
                        <span>${dic.name}</span>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </c:forEach>
                </td>
            </tr>

            <tr>
                <td colspan="4" style="background-color: #ccc;text-align: left;">证件信息</td>
            </tr>

            <tr>
                <td colspan="4"><label>个人照片:</label>
                    <a href="javascript:void(0)" class="Fupload">点击重新上传个人照片
                        <input type="file" id="jiankangInfo" name="jiankangInfo" class="Fchange" multiple="multiple"/></a>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <div>
                        <img alt="暂无图片" src="${baoming.jiankangInfo}" width="400" height="270"/>
                    </div>
                </td>
            </tr>

            <tr>
                <td colspan="4">
                    <label>身份证明:</label>
                    <a href="javascript:void(0);" class="Fupload">点击重新上传身份证明
                    <input type="file" id="shenfenInfo" name="shenfenInfo"  class="Fchange" multiple="multiple"/></a>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <div>
                        <img alt="暂无图片" src="${baoming.shenfenInfo}" width="400" height="270"/>
                    </div>
                </td>
            </tr>

            <tr>
                <td colspan="4"><label>保险证明:</label>
                <a href="javascript:void(0)" class="Fupload">点击重新上传保险证明
                <input type="file" id="baoxianInfo" name="baoxianInfo" class="Fchange" multiple="multiple"/></a>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <div>
                        <img alt="暂无图片" src="${baoming.baoxianInfo}" width="400" height="270"/>
                    </div>
                </td>
            </tr>

            <tr>
                <td colspan="4"><label>缴费证明:</label>
                    <a href="javascript:void(0)" class="Fupload">点击重新上传缴费证明
                    <input type="file" id="jiaofeiInfo" name="jiaofeiInfo" class="Fchange" multiple="multiple"/></a>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <div>
                        <img alt="暂无图片" src="${baoming.jiaofeiInfo}" width="400" height="270"/>
                    </div>
                </td>
            </tr>

            <tr>
                <td colspan="4" style="background-color: #ccc;text-align: left;">爱好和梦想</td>
            </tr>

            <tr>
                <td><label>爱好</label></td>
                <td colspan="3">
                    <textarea id="love" name="love" rows="6" cols="80">${baoming.love}</textarea>
                </td>
            </tr>

            <tr>
                <td><label>梦想</label></td>
                <td colspan="3">
                    <textarea id="dream" name="dream" rows="6" cols="80">${baoming.dream}</textarea>
                </td>
            </tr>


        </table>

        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="save();">保存</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="back();">返回</a>
    </form>
</div>
</body>

<script type="text/javascript">
    //出发一次匿名函数，进来时先把勾选的checkBox的值放入bsInfo
    $(function(){
        var str ="";
        $("[name='channel_box']:checked").each(function(){
            str+=$(this).val();
        });
        $("#bsInfo").val(str);
    });

    function save(){
        framework.saveForm($("#safeForm").form(),function (result) {
            if (result.success) {
                framework.alert('提示',result.msg,'info');
                window.parent.mainpage.mainTabs.closeCurrentTab();
                return true;
            }else{
                framework.alert('提示',result.msg,'info');
            }
        });
    };

    function back(){
        window.parent.mainpage.mainTabs.closeCurrentTab();
    };

    function checkBox(){
        var str ="";
        $("[name='channel_box']:checked").each(function(){
            str+=$(this).val();
        });
        $("#bsInfo").val(str);
    }

</script>
<script src="${ctx}/static/plugins/easyui/common/YDataGrid.js?v=11" type="text/javascript"></script>
</body>
</html>